<div class="refentry" lang="en" xml:lang="en"><a id="glXUseXFont"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glXUseXFont — create bitmap display lists from an X font</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table><tr><td><code class="funcdef">void <b class="fsfunc">glXUseXFont</b>(</code></td><td>Font  </td><td><var class="pdparam">font</var>, </td></tr><tr><td> </td><td>int  </td><td><var class="pdparam">first</var>, </td></tr><tr><td> </td><td>int  </td><td><var class="pdparam">count</var>, </td></tr><tr><td> </td><td>int  </td><td><var class="pdparam">listBase</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>font</code></em></span></dt><dd><p>
                    Specifies the font from which character glyphs are to be taken.
                </p></dd><dt><span class="term"><em class="parameter"><code>first</code></em></span></dt><dd><p>
                    Specifies the index of the first glyph to be taken.
                </p></dd><dt><span class="term"><em class="parameter"><code>count</code></em></span></dt><dd><p>
                    Specifies the number of glyphs to be taken.
                </p></dd><dt><span class="term"><em class="parameter"><code>listBase</code></em></span></dt><dd><p>
                    Specifies the index of the first display list to be generated.
                </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
            <code class="function">glXUseXFont</code> generates <em class="parameter"><code>count</code></em> display lists,
            named <em class="parameter"><code>listBase</code></em> through
            <math overflow="scroll">

                <mrow>
                    <mi mathvariant="italic">listBase</mi>
                    <mo>+</mo>
                    <mi mathvariant="italic">count</mi>
                    <mo>-</mo>
                    <mn>1</mn>
                </mrow>
            </math>,
            each containing a single <a class="citerefentry" href="glBitmap"><span class="citerefentry"><span class="refentrytitle">glBitmap</span></span></a> command.
            The parameters of the <a class="citerefentry" href="glBitmap"><span class="citerefentry"><span class="refentrytitle">glBitmap</span></span></a> command of display list
            <math overflow="scroll">

                <mrow>
                    <mi mathvariant="italic">listBase</mi>
                    <mo>+</mo>
                    <mi mathvariant="italic">i</mi>
                </mrow>
            </math>
            are derived from glyph
            <math overflow="scroll">

                <mrow>
                    <mi mathvariant="italic">first</mi>
                    <mo>+</mo>
                    <mi mathvariant="italic">i</mi>
                </mrow>
            </math>.
            Bitmap parameters
            <math overflow="scroll"><mi mathvariant="italic">xorig</mi></math>,
            <math overflow="scroll"><mi mathvariant="italic">yorig</mi></math>,
            <math overflow="scroll"><mi mathvariant="italic">width</mi></math>,
            and
            <math overflow="scroll"><mi mathvariant="italic">height</mi></math>
            are computed from font metrics as
            <math overflow="scroll">

                <mrow>
                    <mi mathvariant="italic">descent</mi>
                    <mo>-</mo>
                    <mn>1</mn>
                </mrow>
            </math>,
            <math overflow="scroll">

                <mrow>
                    <mo>-</mo>
                    <mi mathvariant="italic">lbearing</mi>
                </mrow>
            </math>,
            <math overflow="scroll">

                <mrow>
                    <mi mathvariant="italic">rbearing</mi>
                    <mo>-</mo>
                    <mi mathvariant="italic">lbearing</mi>
                </mrow>
            </math>,
            and
            <math overflow="scroll">

                <mrow>
                    <mi mathvariant="italic">ascent</mi>
                    <mo>+</mo>
                    <mi mathvariant="italic">descent</mi>
                </mrow>
            </math>,
            respectively.
            <math overflow="scroll"><mi mathvariant="italic">xmove</mi></math>
            is taken from the glyph's
            <math overflow="scroll"><mi mathvariant="italic">width</mi></math>
            metric,
            and
            <math overflow="scroll"><mi mathvariant="italic">ymove</mi></math>
            is set to zero.
            Finally,
            the glyph's image is converted to the appropriate format for <a class="citerefentry" href="glBitmap"><span class="citerefentry"><span class="refentrytitle">glBitmap</span></span></a>.
        </p><p>
            Using <code class="function">glXUseXFont</code> may be more efficient than accessing the X font and generating
            the display lists explicitly,
            both because the display lists are created on the server without requiring
            a round trip of the glyph data,
            and because the server may choose to delay the creation of each
            bitmap until it is accessed.
        </p><p>
            Empty display lists are created for all glyphs that are requested and
            are not defined in <em class="parameter"><code>font</code></em>.
            <code class="function">glXUseXFont</code> is ignored if there is no current GLX context.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
            <code class="constant">BadFont</code> is generated if <em class="parameter"><code>font</code></em> is not a valid font.
        </p><p>
            <code class="constant">GLXBadContextState</code> is generated if the current GLX context is
            in display-list construction mode.
        </p><p>
            <code class="constant">GLXBadCurrentWindow</code> is generated if the drawable associated
            with the current context of the calling thread is a window, and that
            window is no longer valid.
        </p></div>
        {$pipelinestall}{$examples}
        <div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
            <a class="citerefentry" href="glBitmap"><span class="citerefentry"><span class="refentrytitle">glBitmap</span></span></a>,
            <a class="citerefentry" href="glXMakeCurrent"><span class="citerefentry"><span class="refentrytitle">glXMakeCurrent</span></span></a>
        </p></div><div class="refsect1" lang="en" xml:lang="en"><div id="Copyright"><h2>Copyright</h2><p>
            Copyright © 1991-2006
            Silicon Graphics, Inc. This document is licensed under the SGI
            Free Software B License. For details, see
            <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
        </p></div></div></div>
